package com.example.test.bean;

import org.apache.commons.lang3.ObjectUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class EqualsConfig{

    @Bean
    public EqualsFunction registerEqualsFunction(){
        return new EqualsFunction<>((tree1,tree2)->
                ObjectUtils.equals(tree1.getId(),tree2.getId())
                && ObjectUtils.equals(tree1.getPid(),tree2.getPid())
        );
    }
}